package org.example.model;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * @Author: wwy
 * @Date: 2020/11/27 9:18
 */
public class ApplicationProcess {
    private final long id;
    private final StringProperty defaultName;
    private final StringProperty listenPort;
    private final StringProperty appName;
    private final StringProperty appAddress;
    private final StringProperty pid;
    private final int status;
    private final StringProperty statusName;

    public ApplicationProcess(long id, String appName, String appAddress, String pid, Integer status, String statusName,String defaultName,String listenPort) {
        this.id = id;
        this.appName = new SimpleStringProperty(appName);
        this.appAddress = new SimpleStringProperty(appAddress);
        this.pid = new SimpleStringProperty(pid);
        this.status = status;
        this.statusName = new SimpleStringProperty(statusName);
        this.defaultName = new SimpleStringProperty(defaultName);
        this.listenPort = new SimpleStringProperty(listenPort);
    }

    public long getId() {
        return id;
    }

    public String getAppName() {
        return appName.get();
    }

    public StringProperty appNameProperty() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName.set(appName);
    }

    public String getAppAddress() {
        return appAddress.get();
    }

    public StringProperty appAddressProperty() {
        return appAddress;
    }

    public void setAppAddress(String appAddress) {
        this.appAddress.set(appAddress);
    }

    public String getPid() {
        return pid.get();
    }

    public StringProperty pidProperty() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid.set(pid);
    }

    public int getStatus() {
        return status;
    }

    public String getStatusName() {
        return statusName.get();
    }

    public StringProperty statusNameProperty() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName.set(statusName);
    }

    public String getDefaultName() {
        return defaultName.get();
    }

    public StringProperty defaultNameProperty() {
        return defaultName;
    }

    public void setDefaultName(String defaultName) {
        this.defaultName.set(defaultName);
    }

    public String getListenPort() {
        return listenPort.get();
    }

    public StringProperty listenPortProperty() {
        return listenPort;
    }

    public void setListenPort(String listenPort) {
        this.listenPort.set(listenPort);
    }

    @Override
    public String toString() {
        return "ApplicationProcess{" +
                "id=" + id +
                ", defaultName=" + defaultName +
                ", listenPort=" + listenPort +
                ", appName=" + appName +
                ", appAddress=" + appAddress +
                ", pid=" + pid +
                ", status=" + status +
                ", statusName=" + statusName +
                '}';
    }
}
